<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">



<ui:composition template="/template/template.xhtml">

	<ui:define name="conteudo">
		<p:growl autoUpdate="true" life="3000" showDetail="false" />
		<p:growl id="msg" autoUpdate="true" life="3000" showDetail="false" />


		<div class="row-fluid" style="width: 800;">
			<h:form id="visualizar">
				<p:dataGrid var="item" value="#{sessionBean.itens}" columns="1"
					layout="grid" rows="12" paginator="true" id="prod"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="6,12,16">

					<f:facet name="header">
            Shopping Cart
            
					</f:facet>

					<div class="row-fluid" style="margin-left: 50px; margin-top: 2px">
						<div class="span2">

							<img class="pictures" src="img/#{item.produtoItem.picture}.jpg" 
							style="border-radius: 10px; border: solid 1px; width: 150px; height: 150px"/>

						</div>
						<div class="span3">
			
							<strong><h:outputText value="Product: " /></strong>
							<h:outputText value="#{item.produtoItem.name}" />
							<br /> <strong><h:outputText value="Description: " /></strong>
							<h:outputText value="#{item.produtoItem.description}" />
							<br /> <strong><h:outputText value="Catalog: " /></strong>
							<h:outputText value="#{item.produtoItem.catalog.name}" />
							<br /> <strong><h:outputText value="Manufacture: " /></strong>
							<h:outputText value="#{item.produtoItem.manufacture}" />
							<br />
							<div class="linha">
								<strong><h:outputText value="Size: "
										rendered="#{item.produtoItem.size != null}" /></strong>
								<h:outputText value="#{item.produtoItem.size}" />
							</div>
							
							<div class="linha">
								<strong><h:outputText value="Color: "
										rendered="#{item.produtoItem.color != null}" /></strong>
								<h:outputText value="#{item.produtoItem.color}" />
						</div>
						</div>
						<div class="span3">
							<strong><h:outputText value="Value R$: " /></strong>
							<h:outputText value = "#{item.produtoItem.price}" />
							<br />
							<strong><h:outputText value="Amount:" /></strong>
							<h:outputText value="#{item.product_quantity}" />
							<p:commandButton value="" update="growl" rendered="#{item.product_quantity > 1}"
								actionListener="#{sessionBean.diminuirQuantidade(item)}"
								icon="ui-icon-minusthick" ajax="false" class="btqtd" />
							<p:commandButton value="" update="growl"
								action="#{sessionBean.aumentarQuantidade(item)}"
								icon="ui-icon-plus" ajax="false" class="btqtd" />
							<br />


						</div>
						<div class="span4">
							<p:commandButton value="Delete item" update="@(msg)"
								action="#{sessionBean.excluirDoCarrinho(item)}"
								icon="ui-icon-add" ajax="false" />
						</div>
						<hr />
					</div>
					<div class="row-fuid">
						<hr />

					</div>

				</p:dataGrid>
				<f:facet name="below">

				</f:facet>
			</h:form>
		</div>
		<div class="subtotal">
			<center>

				<strong><p:commandButton rendered="#{sessionBean.carrinhoVazio == false}"
					class="btn btn-danger btnconf" value="CONFIRM REQUEST"
					action="#{sessionBean.finalizarPedido}" />
				<h:outputText value="SUBTOTAL: R$ #{sessionBean.subTotal}"
					class="valor" /></strong>


			</center>


		</div>
	</ui:define>
</ui:composition>
</html>